from flask.ext.session import Session
from flask.ext.sqlalchemy import SQLAlchemy
from flask import Flask
from flask.ext.wtf import CSRFProtect
from redis import StrictRedis
from config import config

app = Flask(__name__)
app.config.from_object(config["development"])

# 初始化数据库
db = SQLAlchemy(app)
# 初始化 redis 存储对象
redis_store = StrictRedis(host=config["development"].REDIS_HOST, port=config["development"].REDIS_PORT)
# 开启当前项目的 CSRF 保护, 只做服务器的检验功能
CSRFProtect(app)
# 设置session保存的指定位置
Session(app)
